﻿using Kavaa.Modules.PortailMedical.Entity;
using Kavaa.Modules.PortailMedical.Proxy;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Kavaa.Modules.PortailMedical.Presentation.Services
{
    internal static class Cabinet
    {
      
        /// <summary>
        /// Retourne la liste des mises à jour en cours
        /// </summary>
        public static List<Clinique> DecouvrirCliniques(int acteId, int villeId, int userId)
        {
            //Kavaa.Modules.PortailMedical.Interface.IPortailMedical inter = new Kavaa.Modules.PortailMedical.Services.PortailMedical();
            //return inter.DecouvrirCliniques(acteId, villeId);
            return (new CabinetClient()).DecouvrirCliniques(acteId, villeId, userId);
        }
        /// <summary>
        /// Retourne la liste des mises à jour en cours
        /// </summary>
        public static void AddAccreditation(int MedecinId, int CliniqueId, int ActeId)
        {
            (new CabinetClient()).AddAccreditation(MedecinId, CliniqueId, ActeId);
        }
        public static Accreditations GetAccreditationsEnCoursByUser(int userId)
        {
            return (new CabinetClient()).GetAccreditationsEnCoursByUser(userId);
        }
        public static Accreditations GetAccreditationsAccordeesByUser(int userId)
        {
            return (new CabinetClient()).GetAccreditationsAccordeesByUser(userId);
        }
        public static Accreditations GetAccreditationsRefuseesByUser(int userId)
        {
            return (new CabinetClient()).GetAccreditationsRefuseesByUser(userId);
        }
        public static Cliniques DecouvrirCliniquesAccredit(int acteId, int userId)
        {
            return (new CabinetClient()).DecouvrirCliniquesAccredit(acteId, userId);
        }
        public static Reservations GetReservbloquees(int CliniqueId, int acteId)
        {
            return (new CabinetClient()).GetReservbloquees(CliniqueId, acteId);
        }
        public static int SaveReservation(int id, DateTime DateDebut, DateTime DateFin, int ActeId, int CliniqueId, int MedecinId, String body)
        {
            return (new CabinetClient()).SaveReservation(id, DateDebut, DateFin, ActeId, CliniqueId, MedecinId, body);
        }
        public static Categories GetBlocsDispo(DateTime DateDebut, DateTime DateFin, int CliniqueId, int acteId)
        {
            return (new CabinetClient()).GetBlocsDispo(DateDebut, DateFin, CliniqueId, acteId);
        }
        public static Boolean IsMedecinFree(DateTime DateDebut, DateTime DateFin, int IdMedecin)
        {
            return (new CabinetClient()).IsMedecinFree(DateDebut, DateFin, IdMedecin);
        }
        public static void AddReservCategorie(int ReservId, int BlocId)
        {
            (new CabinetClient()).AddReservCategorie(ReservId, BlocId);
        }
        public static Reservations GetReservMedecin(int IdMedecin)
        {
            return (new CabinetClient()).GetReservMedecin(IdMedecin);
        }
        public static void UpdateReservation(DateTime DateDebut, DateTime DateFin, int ActeId, int CliniqueId, int MedecinId, String body, int id)
        {
            (new CabinetClient()).UpdateReservation(DateDebut, DateFin, ActeId, CliniqueId, MedecinId, body, id);
        }
        public static Boolean existReserv(int id_reserv)
        {
            return (new CabinetClient()).existReserv(id_reserv);
        }
        public static int GetLastIndexReserv()
        {
            return (new CabinetClient()).GetLastIndexReserv();
        }
        public static void DeleteReserv(int reservId)
        { (new CabinetClient()).DeleteReserv(reservId); }

        public static Proprietes GetProprietesCategorie(int id_categorie)
        {
            return (new CabinetClient()).GetProprietesCategorie(id_categorie);
        }

        public static Reservations GetReservMedecinEnCours(int IdMedecin)
        {
            return (new CabinetClient()).GetReservMedecinEnCours(IdMedecin);
        }

        public static Reservations GetReservMedecinAccordees(int IdMedecin)
        {
            return (new CabinetClient()).GetReservMedecinAccordees(IdMedecin);
        }

        public static Reservations GetReservMedecinRefusees(int IdMedecin)
        {
            return (new CabinetClient()).GetReservMedecinRefusees(IdMedecin);
        }


        public static void UpdateReservConfirmee(int idReserv, int idPatient, string RemarquesPatient)
        {
           (new CabinetClient()).UpdateReservConfirmee(idReserv, idPatient,RemarquesPatient);
        }
        public static int AddPatient(Patient patient)
        {
            return (new CabinetClient()). AddPatient(patient);
        }
        public static Reservation GetInfoConvocation(int ReservId)
        {
            return (new CabinetClient()).GetInfoConvocation(ReservId);
        }

    }
}